package com.example.clxy.dao;

import com.example.clxy.entity.Schedule;
import com.example.clxy.entity.vo.ScheduleWlclassVo;
import com.example.clxy.result.business.PageResult.SchedulePageResult;
import com.example.clxy.result.business.PageResult.SemesterPageResult;
import com.example.clxy.result.business.ScheduleResult;
import com.example.clxy.result.business.ScheduleSafetynoticeResult;
import com.example.clxy.result.business.WlClassResult;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ScheduleMapper {
    int deleteByPrimaryKey(String scheduleid);

    int insert(Schedule record);

    int insertSelective(Schedule record);

    Schedule selectByPrimaryKey(String scheduleid);

    int updateByPrimaryKeySelective(Schedule record);

    int updateByPrimaryKey(Schedule record);

    int addSchedule(@Param("scheduleList") List<Schedule> scheduleList);

    int deleteSchedule(String scheduleid);

    List<SchedulePageResult> getScheduleListBySemesteridTeacherN(@Param("teacherid") String teacherid,
                                                                 @Param("semesterid") String semesterid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("platformid") String platformid,
                                                                 @Param("wlclassid") String wlclassid,
                                                                 @Param("wlclassname") String wlclassname,
                                                                 @Param("grade") String grade,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize,
                                                                 @Param("currentdate") Date currentdate);

    List<SchedulePageResult> getScheduleListBySemesteridTeacherY(@Param("teacherid") String teacherid,
                                                                 @Param("semesterid") String semesterid,
                                                                 @Param("platformid") String platformid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("wlclassid") String wlclassid,
                                                                 @Param("wlclassname") String wlclassname,
                                                                 @Param("grade") String grade,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize,
                                                                 @Param("currentdate") Date currentdate);

    List<SchedulePageResult> getScheduleListBySemesteridStudentN(@Param("studentid") String studentid,
                                                                 @Param("semesterid") String semesterid,
                                                                 @Param("platformid") String platformid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize,
                                                                 @Param("currentdate") Date currentdate);

    List<SchedulePageResult> getScheduleListBySemesteridStudentY(@Param("studentid") String studentid,
                                                                 @Param("semesterid") String semesterid,
                                                                 @Param("platformid") String platformid,
                                                                 @Param("experimentname") String experimentname,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize,
                                                                 @Param("currentdate") Date currentdate);


    List<SchedulePageResult> getScheduleListBySemesteridAdminN(@Param("semesterid") String semesterid,
                                                               @Param("platformid") String platformid,
                                                               @Param("experimentname") String experimentname,
                                                               @Param("wlclassid") String wlclassid,
                                                               @Param("wlclassname") String wlclassname,
                                                               @Param("grade") String grade,
                                                               @Param("begin") int begin,
                                                               @Param("end") int end,
                                                               @Param("pagesize") int pagesize,
                                                               @Param("currentdate") Date currentdate);

    List<SchedulePageResult> getScheduleListBySemesteridAdminY(@Param("semesterid") String semesterid,
                                                               @Param("platformid") String platformid,
                                                               @Param("experimentname") String experimentname,
                                                               @Param("wlclassid") String wlclassid,
                                                               @Param("wlclassname") String wlclassname,
                                                               @Param("grade") String grade,
                                                               @Param("begin") int begin,
                                                               @Param("end") int end,
                                                               @Param("pagesize") int pagesize,
                                                               @Param("currentdate") Date currentdate);

    List<SchedulePageResult> getScheduleListByWeekTeacher(@Param("teacherid") String userid,
                                                          @Param("begin") int begin,
                                                          @Param("end") int end,
                                                          @Param("pagesize") int pagesize,
                                                          @Param("starttime") String starttime,
                                                          @Param("endtime") String endtime);

    List<SchedulePageResult> getScheduleListByWeekStudent(@Param("studentid") String userid,
                                                          @Param("begin") int begin,
                                                          @Param("end") int end,
                                                          @Param("pagesize")  int pagesize,
                                                          @Param("starttime") String starttime,
                                                          @Param("endtime") String endtime);

    List<SchedulePageResult> getScheduleListByWeekAdmin(@Param("begin") int begin,
                                                        @Param("end") int end,
                                                        @Param("pagesize") int pagesize,
                                                        @Param("starttime") String starttime,
                                                        @Param("endtime") String endtime);


    ScheduleResult getScheduleByid(String scheduleid);

    List<SchedulePageResult> getSemesterListHaveSchedule(@Param("begin") int begin,
                                                         @Param("end") int end,
                                                         @Param("pagesize") int pagesize,
                                                         @Param("semestername") String semestername);

    List<SemesterPageResult> getSemesterNoProgramList();

    int addSemesterProgram(Schedule schedule);

    int deleteSemesterProgram(@Param("semesterid") String semesterid, @Param("programid") String programid);

    int updateSemesterProgram(@Param("semesterid") String semesterid,@Param("programid") String programid,@Param("updatedTime") Date updatedTime);

    List<SchedulePageResult> getSemesterProgram(@Param("begin") int begin,
                                                @Param("end") int end,
                                                @Param("pagesize") int pagesize,
                                                @Param("semestername") String semestername,
                                                @Param("programname") String programname,
                                                @Param("programid") String programid);


    String getScheduleidByWlclass(@Param("wlclassid") String wlclassid,
                                  @Param("startdate") String startdate,
                                  @Param("semesterid") String semesterid,
                                  @Param("experimentid") String experimentid);


    int addScheduleWlclass(@Param("scheduleWlclassVoList") List<ScheduleWlclassVo> scheduleWlclassVoList);

    int deleteScheduleWlclass(String scheduleid);

    List<WlClassResult> getWlClassResults(String scheduleid);

    int getScheduleByTeacheridAndTime(@Param("teacherid") String teacherid,
                                      @Param("startDate") String startDate,
                                      @Param("endDate") String endDate);

    int getScheduleBywlclassidAndTime(@Param("wlclassid") String wlclassid,
                                      @Param("startDate") String startDate,
                                      @Param("endDate") String endDate);

    int getScheduleCountsbyId(@Param("semesterid") String semesterid,
                              @Param("programid") String programid);

    ScheduleSafetynoticeResult getSafetynoticeByScheduleid(@Param("scheduleid") String scheduleid);
}